package com.example.bean;

import org.springframework.beans.factory.FactoryBean;

public class StudentFactoryBean implements FactoryBean {

    private Student student;

    public StudentFactoryBean(){
        student = new Student();
        student.setName("张三");
    }

    @Override
    public Object getObject() throws Exception {
        return student;
    }


    @Override
    public Class<?> getObjectType() {
        return Student.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
